﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        x:Class="SpriteSheetsCreator.MainWindow"
        mc:Ignorable="d"
        Title="Sprites sheets Creator" Height="600" Width="1024" Closing="Window_Closing" MinWidth="1024" MinHeight="600" Icon="Images/appli_icon.png">
    <Grid Width="auto">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFE1E8F3" Offset="0"/>
                <GradientStop Color="White" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Background>
        <StackPanel Orientation="Horizontal" Width="auto">
            <Grid Width="auto">
                <StackPanel Orientation="Vertical">
                    <!-- IMAGES LIST -->
                    <ListBox x:Name="fromImagesListBox" Height="300" DragEnter="fromImagesListBox_DragEnter" DragOver="fromImagesListBox_DragEnter" Drop="fromImagesListBox_Drop" AllowDrop="True" DragLeave="fromImagesListBox_DragLeave" SelectionChanged="fromImagesListBox_SelectionChanged" Margin="10,5,10,0">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="{Binding ImageBitmap}" Height="50"/>
                                    <Label Content="{Binding ImageName}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <Border x:Name="dropFilesThereBorder" Height="60" Width="200" Margin="0,-80,0,0" CornerRadius="2">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FF24377E" Offset="0"/>
                                <GradientStop Color="#FF17234B" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                        <TextBlock Text="Drop PNG files there" Foreground="White" FontSize="18" VerticalAlignment="Center" TextAlignment="Center"/>
                    </Border>
                    <StackPanel Orientation="Vertical" Margin="10,5,10,10">
                        <!-- FILES MANAGEMENT BUTTONS -->
                        <StackPanel Orientation="Horizontal" Height="30" Margin="0,5,0,0">
                            <Button Margin="0" Width="120" Click="OpenFileButton_Click" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="Images/file.png" Height="17" Margin="10,0,0,0"/>
                                    <TextBlock Text="Open Files" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                            <Button Width="120" Margin="20,0,0,0" Click="RemoveItemsButton_Click" ToolTip="Hold control key to clear list" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="Images/remove.png" Height="17" Margin="10,0,0,0"/>
                                    <TextBlock Text="Remove" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                            <Button Width="120" Margin="20,0,0,0" Click="MoveUpButton_Click" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="Images/arrowUp.png" Height="17" Margin="10,0,0,0"/>
                                    <TextBlock Text="Move up" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                            <Button Width="120" Margin="20,0,0,0" Click="MoveDownButton_Click" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="Images/arrowDown.png" Height="17" Margin="10,0,0,0"/>
                                    <TextBlock Text="Move down" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                        </StackPanel>

                        <!-- ANIMATION CONTROL -->
                        <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                            <TextBlock Text="Autoreverse animation" Margin="5,0" VerticalAlignment="Center"/>
                            <CheckBox x:Name="autoReverseCheckBox" Margin="0,5,0,0" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                            <TextBlock Text="Animation speed:" Margin="5,0" VerticalAlignment="Center"/>
                            <TextBox x:Name="animSpeedTextBox" Width="50" Text="33"/>
                            <TextBlock Text="ms / frame" Margin="5,0" VerticalAlignment="Center"/>
                            <Slider x:Name="animSpeedSlider" Value="33" Maximum="1000" Width="250" Margin="20,0" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                            <Button Margin="0" Click="PlayButton_Click" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="Images/play.png" Height="17" Margin="10,0,0,0"/>
                                    <TextBlock Text="Play" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                            <Button Margin="20,0,0,0" Click="StopButton_Click" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="Images/stop.png" Height="20" Margin="10,0,0,0"/>
                                    <TextBlock Text="Stop" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                            <Button Margin="20,0,0,0" Click="DefaultSettingsButton_Click" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="Default settings" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                        </StackPanel>
                        <Expander BorderBrush="Gray" Header="Additional parameters" Margin="0,5,0,0" Padding="10,5" Background="#7FC0C3C9">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Preview images stretching:" Margin="5,0" VerticalAlignment="Center"/>
                                <ComboBox x:Name="imagePreviewStretchStyle" SelectedIndex="1" >
                                    <ComboBoxItem Content="Fill"/>
                                    <ComboBoxItem Content="None"/>
                                    <ComboBoxItem Content="Uniform"/>
                                    <ComboBoxItem Content="UniformToFill"/>
                                </ComboBox>
                            </StackPanel>
                        </Expander>
                        <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                            <Button Margin="20,0,0,0" Click="SaveButton_Click" Style="{DynamicResource ButtonStyleWithLeftImage}">
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="Images/save.png" Height="20" Margin="10,0,0,0"/>
                                    <TextBlock Text="Export sprites sheet to PNG file" Margin="10,0"/>
                                </StackPanel>
                            </Button>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </Grid>
            <Grid ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <ScrollViewer x:Name="imagePreviewScroller" Background="White" Width="400" Margin="5" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch">
                    <Image Height="auto" x:Name="imagePreview" UseLayoutRounding="False" Stretch="None"/>
                </ScrollViewer>
            </Grid>
        </StackPanel>


    </Grid>
</Window>
